import javax.swing.JPanel;

import com.pi4j.io.gpio.GpioController;
import com.pi4j.io.gpio.GpioFactory;
import com.pi4j.io.gpio.GpioPinDigitalInput;
import com.pi4j.io.gpio.GpioPinDigitalOutput;
import com.pi4j.io.gpio.PinPullResistance;
import com.pi4j.io.gpio.PinState;
import com.pi4j.io.gpio.RaspiPin;

public class MainClass {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		// create gpio controller
		GpioController gpio = GpioFactory.getInstance();

		// provision gpio pin #01 as an output pin and turn off
		GpioPinDigitalOutput outputPin = gpio.provisionDigitalOutputPin(
				RaspiPin.GPIO_01, "MyLED", PinState.LOW);

		// turn output to LOW/OFF state
		outputPin.low();
		
		// turn output to HIGH/ON state
		outputPin.high();

		// provision gpio pin #02 as an input pin with its internal pull down
		// resistor enabled
		GpioPinDigitalInput inputPin = gpio.provisionDigitalInputPin(
				RaspiPin.GPIO_02, "MyButton", PinPullResistance.PULL_DOWN);

		// get input state from pin 2
		boolean input_value = inputPin.isHigh();
	}

}
